<template>
  <div id="text">
    <h1>当前值为{{$store.state.token}}</h1>
    <button @click="getToken">你点我一下</button>
  </div>
</template>

<script>
export default {
  name: 'test',
  data () {
    return {
      token: undefined
    }
  },
  mounted () {
    console.log(this.$store)
  },
  methods: {
    getToken () {
      this.$store.dispatch('token', this.nums)
    }
  }
}
</script>

<style scoped>

</style>
